classDiagram
    class Director {
        -builder: Builder
        +setBuilder(builder: Builder): void
        +construct(): Product
    }
    
    class Builder {
        <<interface>>
        +buildPartA(): void
        +buildPartB(): void
        +buildPartC(): void
        +getResult(): Product
    }

    class ConcreteBuilder1 {
        -product: Product
        +buildPartA(): void
        +buildPartB(): void
        +buildPartC(): void
        +getResult(): Product
    }

    class ConcreteBuilder2 {
        -product: Product
        +buildPartA(): void
        +buildPartB(): void
        +buildPartC(): void
        +getResult(): Product
    }

    class Product {
        +parts: List~string~
        +add(part: string): void
        +listParts(): string
    }

    Director --> Builder : uses
    Builder <|-- ConcreteBuilder1 : implements
    Builder <|-- ConcreteBuilder2 : implements

    ConcreteBuilder1 --> Product : builds
    ConcreteBuilder2 --> Product : builds
